package main

import (
    "encoding/json"
    "fmt"
)

type jsonStruct struct {
    Id int  `json:"id"`
    Name string `json:"name"`
    Inser
}

type Inser struct {
    Old string `json:"old"`
    Number string `json:"number"`
}

func main() {
    a := []jsonStruct{
        {Id: 1},
        {Id: 2, Name: "gdg"},
    }
    a[0].Old="old"
    a[0].Number="1"
    js, _:= json.Marshal(a)
    str := string(js)
    fmt.Println(str)
    b :=[]*jsonStruct{}
    json.Unmarshal([]byte(str), &b)
    fmt.Printf("%+v \n", b)
    for _, v := range b {
        fmt.Println(v)
    }
}
